<?php


include_once '../../../plugins/doctrine/lib/doctrine.php';
include_once 'CF_ProcessorBaseTest.php';
include_once '../../../fieldspec/customers_fields.php';

spl_autoload_register(array('Doctrine', 'autoload'));





$proc = new CF_ProcessorBaseTest;

$proc->fieldspec = $fieldspec;

$ar_test = array('one'=>'first','two'=>'second','three'=>'thrid','four'=>'fourth');
$ar_spec = array('one','two','four');

print $proc->CheckArrayComplete($ar_test,$ar_spec);
print_r($ar_test);
print '<br />';
$proc->FilterByList($ar_test,$ar_spec);
print_r($ar_test);
unset($ar_test['one']);
print_r($ar_test);
print $proc->CheckArrayComplete($ar_test,$ar_spec);
print_r($proc->fieldspec);
$proc->ProcessFieldSpec();
print_r($proc->col_list);
print_r($proc->key_list);


print "<br /> Test: GetReqParamsByList($list,$prefix = '',$requireall = false) <br />/testCF_Processor2.php?mmone=FirstOne&mmtwo=SecondOne&mmthree=ThrdOne&mmfour=FourthOne<br />";
$newvalues = $proc->GetReqParamsByList($ar_spec,'mm',false);
print_r($newvalues);

print "<br /> Test: GetPackedParamValues($VarParam, $ValParam, $prefix = '', $limit=false)) <br />testCF_Processor2.php?cols=one,two,three,four&stuff=firstthing,secondthing,thirdthing,fourththing<br />";
$newvalues = $proc->GetPackedParamValues('cols','stuff');
print_r($newvalues);

print "<br /> Test: GetPackedParamSets($VarParam, $ValParam, $prefix = '', $limit=false)) <br />testCF_Processor2.php?mode=Save&cols=one,two,three,four&stuff=firstthing,secondthing,thirdthing,fourththing;1,2,3,4;uno,dos,tres,cuatro<br />";
$newvalues = $proc->GetPackedParamSets('cols','stuff');
print_r($newvalues);

print "<br /> Test: GetReqOp() <br />testCF_Processor2.php?mode=Save</br />";
print "Got: " . $proc->GetReqOp();
print "Opcode is " . $proc->operation;

print "<br /> Test: GetSingleValue(\$varParam = 'var',\$valParam = 'value')) <br />testCF_Processor2.php?mode=Save&cols=one,two,three,four&stuff=firstthing,secondthing,thirdthing,fourththing;1,2,3,4;uno,dos,tres,cuatro<br />";
$newvalues = $proc->GetSingleValue('cols','stuff');
print_r($newvalues);

$proc->Run();

$proc->maintable = 'my_records';
$proc->CalculateModelName();
print 'Model Name is :' . $proc->ModelName;

?>